package com.sina.weibo;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import com.sina.weibo.view.BaseLayout;

public abstract class BaseActivity extends ScreenOrientationBaseActivity
  implements View.OnClickListener
{
  public static final int BG_BUTTON1 = 2;
  public static final int BG_BUTTON2 = 3;
  public static final int BG_BUTTON3 = 4;
  public static final int LEFT_BUTTON = 1;
  protected BaseLayout ly;
  protected RelativeLayout titleBar;

  protected abstract void handleTitleBarEvent(int paramInt);

  public void onClick(View paramView)
  {
    Button localButton1 = this.ly.leftButton;
    if (paramView == localButton1)
      handleTitleBarEvent(1);
    while (true)
    {
      //return;
      Button localButton2 = this.ly.rightButton;
      if (paramView == localButton2)
      {
        handleTitleBarEvent(0);
        continue;
      }
      Button localButton3 = this.ly.mButton1;
      if (paramView == localButton3)
      {
        handleTitleBarEvent(2);
        continue;
      }
      Button localButton4 = this.ly.mButton2;
      if (paramView == localButton4)
      {
        handleTitleBarEvent(3);
        continue;
      }
      Button localButton5 = this.ly.mButton3;
      if (paramView != localButton5)
        continue;
      handleTitleBarEvent(4);
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
  }

  protected void setAppTitle(String paramString1, String paramString2)
  {
  }

  protected void setTitleBar(int paramInt, String paramString1, String paramString2, String paramString3)
  {
    if (this.ly != null)
      this.ly.setButtonTypeAndInfo(paramInt, paramString1, paramString2, paramString3);
  }

  protected void setView(int paramInt)
  {
    BaseLayout localBaseLayout1 = new BaseLayout(this, paramInt);
    this.ly = localBaseLayout1;
    BaseLayout localBaseLayout2 = this.ly;
    setContentView(localBaseLayout2);
    this.ly.leftButton.setOnClickListener(this);
    this.ly.rightButton.setOnClickListener(this);
    this.ly.mButton1.setOnClickListener(this);
    this.ly.mButton2.setOnClickListener(this);
    this.ly.mButton3.setOnClickListener(this);
  }
}